From 90491e4e21cdcd86ca2262b7d8a60e181fbf2c32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 16 Nov 2008 20:35:57 +0000 Subject: [PATCH] show in red the conversions that are worse than the current BABL_TOLERANCE * babl/babl-fish-stats.c: (legal_error), (each_conv): show in red the conversions that are worse than the current BABL_TOLERANCE instead of the earlier arbitrary 0.01. svn path=/trunk/; revision=358 --- ChangeLog | 6 ++++++ babl/babl-fish-stats.c | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d6ea0b2..49d41ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-16 Øyvind Kolås + + * babl/babl-fish-stats.c: (legal_error), (each_conv): show in red the + conversions that are worse than the current BABL_TOLERANCE instead of + the earlier arbitrary 0.01. + 2008-11-16 Martin Nordholts * babl/babl-fish-path.c: Use the default babl tolerance level if diff --git a/babl/babl-fish-stats.c b/babl/babl-fish-stats.c index 9f938c3..d9fa9ba 100644 --- a/babl/babl-fish-stats.c +++ b/babl/babl-fish-stats.c @@ -202,6 +202,24 @@ table_source_each (Babl *babl, return 0; } +/* copied from babl-fish-path.c */ +#define BABL_LEGAL_ERROR 0.000001 +static double legal_error (void) +{ + static double error = 0.0; + const char *env; + + if (error != 0.0) + return error; + + env = getenv ("BABL_TOLERANCE"); + if (env && env[0] != '\0') + error = atof (env); + else + error = BABL_LEGAL_ERROR; + return error; +} + static int each_conv (Babl *babl, void *data) @@ -214,7 +232,7 @@ each_conv (Babl *babl, error = babl_conversion_error (&babl->conversion); cost = babl_conversion_cost (&babl->conversion); - if (error > 0.01) + if (error > legal_error ()) { fprintf (output_file, "
%s
", babl->instance.name); fprintf (output_file, "
"); -- 2.30.2